<%@page contentType="text/html;charset=UTF-8"%>
<%@include file="/common/commonTag.jsp"%>
<html>
	<head>
		<title>首页导航条</title>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<script type="text/javascript" src="${path}/js/jquery.js"></script>
		<script type="text/javascript" src="${path}/js/CommonsUtil.js"></script>
		<script type="text/javascript" src="${path}/js/exportHTML.js"></script>
		<link rel="stylesheet" type="text/css" href="${path}/style/styles.css">
		<link rel="stylesheet" type="text/css" href="${path}/style/main.css">
		
		<script type="text/javascript">
			function checkVal() {
				var form = document.forms[0];
				var ids = "" ;
				
				if(undefined != form.ids) {
					for(var i=0; i<form.ids.length; i++) {
						if(form.ids[i].checked) {
							ids += form.ids[i].value+"," ;
						}
					}
					if("" != ids) {
						ids = ids.substring(0,ids.length-1) ;
						var url = "${path}/website/naviItem!exportHTML.action?ids="+ids ;
						exporHtml(url) ;
					} else {
						alert("请选择，再提交..") ;
						return ;
					}
				}
			}
		</script>
		
	</head>
	<body>
		<div class="centext">
			<div class="context_head">
				后台管理 &gt;&gt; 查询首页导航条
			</div>
			<div class="context_main_1">
				<form action="${path}/website/navi!deleteSiteNavi.action" method="post">
				<table class="tables" width="100%">
					<tr>
						<th class="th1 hand" onclick="select('selected')">全选</th>							
						<th class="th1">导航条分类ID</th>							
						<th class="th1">导航条分类名称</th>							
						<th class="th1">缺省模板</th>							
						<th class="th1">HTML输出名称</th>							
						<th class="th1">是否隐藏</th>							
						<th class="th1">添加时间</th>							
						<th class="th1">操作</th>							
					</tr>
					
					<c:choose>
						<c:when test="${empty naviItemList}">
							<td class="td3" colspan="8" style="height:50px;" align=center><a href="${path}/supersystem/website/navi/addNaviItem.jsp">添加</a></td>
						</c:when>
						<c:otherwise>
							<c:forEach var="naviItem" items="${naviItemList}">
								<tr>
									<td class="td3" align=center>
										<input type="checkbox" name="ids" value="${naviItem.id}" class="selected"/>
									</td>							
									<td class="td3" align=center>${naviItem.id}</td>							
									<td class="td3" align=center><a href="${path}/website/naviItem!queryByIdSni.action?sni.id=${naviItem.id}&baseform.type=loadNavi">${naviItem.sitemNItemName}</a></td>
									<td class="td3" align=center>${naviItem.templateName}</td>
									<td class="td3" align=center>${naviItem.exportHtmlName}</td>
									<td class="td3" align=center>${naviItem.isShow}</td>
									<td class="td3" align=center><fmt:formatDate value="${naviItem.addTime}" pattern="yyyy-MM-dd"/></td>
									<td class="td3" align=center>
										<a href="${path}/supersystem/website/navi/addNaviItem.jsp">添加</a>
										<a href="javascript:openWin('${path}/website/naviItem!queryByIdSni.action?sni.id=${naviItem.id}','',500,300);">修改</a>
									</td>
								</tr>
							</c:forEach>
						</c:otherwise>
					</c:choose>
					
					<tr>
						<td colspan="11"  class="td3_bottom">
							<input type="button" onclick="checkVal()" class="btobg" value="生成HTML">
						</td>
					</tr>
				</table>		
				</form>
			</div>
		</div>
	</body>
</html>
